package com.train.mvc;


import com.train.mvc.service.DemoService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
public class SpringBootMvcApplication {

    @Autowired
    private DemoService demoService;

    public static void main(String[] args) {
        SpringApplication.run(SpringBootMvcApplication.class, args);
    }

    @GetMapping("/hello")
    public String hello(){
        return "***** Hello World *****";
    }

    @GetMapping("/ali")
    public String aliPay(){
        String msg="支付成功";
        return demoService.aliPay(msg);
    }

    @GetMapping("/jd")
    public String jdPay(){
        String msg="未开通京东白条支付";
        return demoService.jdPay(msg);
    }

    @GetMapping("/wx")
    public String weiXinPay(){
        String msg="余额不足，支付失败";
        return demoService.weiXinPay(msg);
    }

}
